﻿namespace EyeOpen.ViewModel
{
    using Microsoft.Practices.Composite.Events;
    using Microsoft.Practices.Composite.Presentation.Events;

    internal class WindowManager<T> where T : CompositePresentationEvent<HandleWindowMessage>
    {
        public void HandleWindow(IEventAggregator theAggregator, bool mustCloseWindow)
        {
            theAggregator
                .GetEvent<T>()
               .Publish(
                    new HandleWindowMessage
                    {
                        MustCloseWindow = mustCloseWindow
                    });
        }
    }
}